package com.joseph.user.controller;

import com.joseph.common.result.Result;
import com.joseph.user.manager.IUserManager;
import com.joseph.user.po.User;
import com.joseph.user.dto.request.UserReq;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 用户管理
 * @author 莫正新
 * @since 2021-07-22
 */
@RestController
@AllArgsConstructor
public class UserController {

    private final IUserManager userManager;

    /**
     * 获取用户
     * @param id 用户id
     * @return
     */
    @GetMapping("/hello")
    public String hello(@RequestParam Integer id, User user) {
        User user1 = userManager.getUser(1);
        System.out.println(user);
        return "hello";
    }

    /**
     * 用户登录
     * @param loginDTO
     * @return
     */
    @PostMapping("/login")
    public Result login(@RequestBody UserReq userReqDTO) {
        return new Result();
    }
}
